
struct SongData
{
	char filename[12];
	char title[30];
	char artist[30];
	char album[30];
};


/**************************************************************************
* Purpose: Determines how many mp3 files there are on sd card partition 1
* Input: No input
* Output: Returns the number of songs found that have extension "mp3"
***************************************************************************/
unsigned long getMp3Count(void);

/**************************************************************************
* Purpose:	Finds the next mp3 file and opens a fileptr to it based on the 
*			prevous song number
* Input: Previous song number (-1 indicates first song...ie song 0)
* Output: Returns a fileptr to song or a null if song dne
***************************************************************************/
struct FAT_FILE_t * getNextMp3File(long long prev);

/****************************************************************************
* Purpose:	Reads up to "num_bytes" from fileptr "fp" and places data in
*			"buf"
* Input:	A destination buffer "buf", the number of bytes to read
*			"num_bytes" and the fileptr "fp"
* Output:   Returns the number of bytes read
****************************************************************************/
int	fat_fread(void * buf, unsigned int num_bytes, struct FAT_FILE_t * fp);

/****************************************************************************
* Purpose:	Buffers in the next sector in file
* Input:	Valid fileptr
* Output:   No Output
****************************************************************************/
void fat_file_buffer_next_sector(struct FAT_FILE_t * fp);

/****************************************************************************
* Purpose:	Seeks to Beginning or End minus offset (not a true implementation
*			of fseek)
* Input:	Valid Fileptr, offset value (if seeking to end), and which end to
*			seek to (1 = END, 0 = BEGIN)
* Output:   Returns 0 on success, non-zero on failure
****************************************************************************/
int fat_fseek(struct FAT_FILE_t *fp, unsigned long offset, unsigned char pos);

/**************************************************************************
* Purpose:	Populates a songdata structure with metadata(if available)
*			from file in fileptr array
* Input:	Array of songdata structure pointers, array of pointers to 
*			fileptrs and the current mp3 file number to populate data from
* Output:	No output...but does load songdata structure in array with data
***************************************************************************/
void getSongData(struct SongData ** song, struct FAT_FILE_t **fpArray, int index);


